import { postRequest, postRequestList, postRequestData, postRequestJson, importFile } from '../utils/request'
// 采购订单
export const pagePurchaseOrderList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/purchase/order/pagePurchaseOrder`, data)
export const getProductBySkuCode = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/commodity/getProductBySkuCode`, data)
export const getProductBySpuCode = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/commodity/getProductBySpuCode`, data)
export const submitPurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/submitPurchaseOrder`, data)
export const exportPurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/exportPurchaseOrder`, data)
export const exportProduceSchedule = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/exportProduceSchedule`, data)
export const batchExportProduceSchedule = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/batchExportProduceSchedule`, data)
export const auditPurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/auditPurchaseOrder`, data)
export const confirmBill = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/confirmBill`, data)
export const rejectProduce = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/rejectProduce`, data)
export const createPurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/createPurchaseOrder`, data)
export const terminatePurchase = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/terminatePurchase`, data)
export const cancelPurchase = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/cancelPurchase`, data)
export const updatePurchaseInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/updatePurchaseInfo`, data)
export const getBillInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/getBillInfo`, data)
export const getPurchaseOrderDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/getPurchaseOrderDetail`, data)
export const updateAppointmentFloatingLimit = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/updateAppointmentFloatingLimit`, data)
export const updateTagPrice = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/updateTagPrice`, data)
export const getPurchaseSummarize = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/getPurchaseSummarize`, data)
export const updatePurchaseAppointmentFloatingLimit = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/updatePurchaseAppointmentFloatingLimit`, data)
export const updatePurchaseCommodity = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/commodity/updatePurchaseCommodity`, data)
export const importPurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/purchase/order/importPurchaseOrder`, data)
export const importPurchaseProduceSchedule = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/purchase/order/importPurchaseProduceSchedule`, data)
export const batchImportDeliveryTime = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/purchase/order/batchImportDeliveryTime`, data)
export const purchaseOrderTodo = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/purchaseOrderTodo`, data)
export const retryPushingCenter = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/retryPushingCenter`, data)
export const reserveInvoicePush = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/push`, data)
export const createPurchaseOrderImportCommodity = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/purchase/order/commodity/createPurchaseOrderImportCommodity`, data)
export const getProduceQty = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/produce/schedule/getProduceQty`, data)
export const getPurchaseSkc = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/order/commodity/getPurchaseSkc`, data)
export const getPurchaseFabric = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchaseFabricOrder/getPurchaseFabric`, data)
export const getSupplierByFabricCode = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchaseFabricOrder/getSupplierByFabricCode`, data)
export const addScheduleInsertNumber = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/insert`, data)
export const updateTransferRule = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/updateTransferRule`, data)
export const savePurchaseFabric = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchaseFabricOrder/savePurchaseFabric`, data)
export const getFabricPriceAndRemark = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchaseFabricOrder/getFabricPriceAndRemark`, data)
export const purchaseOrderUpdateQC = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/updateQC`, data)
export const purchaseOrderUpdateTrackPerson = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/updateTrackPerson`, data)

// 采购合同
export const pagePurchaseContract = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/purchase/contract/pagePurchaseContract`, data)

export const mergeContract = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/mergeContract`, data)

export const cancelMerge = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/cancelMerge`, data)

export const submitContract = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/submitContract`, data)

export const contractTodo = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/purchase/contract/contractTodo`, data)

export const confirmSign = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/confirmSign`, data)

export const trackConfirmContract = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/trackConfirmContract`, data)

export const supplyDuctConfirmContract = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/supplyDuctConfirmContract`, data)

export const updateContractPayType = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/purchase/contract/updatePayType`, data)

export const exportContract = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/contract/exportContract`, data)

export const exportContractDetail = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/contract/exportContractDetail`, data)

export const PrintContract = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/contract/printContract`, data, { timeout: 60000 })

// 预约发货单
export const exportOutNoticeOrder = <T>(data?: any): Promise<any> =>
  postRequestData(`/api/sop/sop/reserveInvoice/exportOutNoticeOrder`, data)

// 扫码装箱
export const getBoxSepcList = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/box/queryBoxSpec`, data)

export const createBoxSepcList = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/box/createAndEditBoxSpec`, data)

export const createBoxLabelList = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/box/createBoxLabel`, data)

export const batchInvalidateBoxLabel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/box/batchInvalidateBoxLabel`, data)

export const queryBoxLabel = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/box/queryBoxLabel`, data)

export const updateBoxLabel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/box/updateBoxLabel`, data)

export const deleteBoxLabel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/box/deleteBoxLabel`, data)

export const addBoxLabel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/box/addBoxLabel`, data)

export const queryPurchaseGoods = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/box/queryPurchaseGoods`, data)

export const scanAndGetInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/box/scanAndGetInfo`, data)

export const getScanCommodityInfo = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/box/getScanCommodityInfo`, data)

export const submitBoxLoad = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/submitBoxLoad`, data)

export const fixArrivalTime = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/fixArrivalTime`, data)

export const tempSaveBoxPaking = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestJson(`/api/sop/sop/box/tempSave`, data)

export const scanAndPacking = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestJson(`/api/sop/sop/box/scanAndPacking`, data)

// QC
export const qualityCreate = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/quality/create`, data)

export const reserveInvoiceCreate = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/create`, data)

export const qualityBatchCancel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/quality/batchCancel`, data)

export const reserveInvoicebatchCancel = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/batchCancel`, data)

export const qualityExecute = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/quality/execute`, data)

export const reserveInvoiceBatchAudit = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/batchAudit`, data)

export const qualityReply = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/quality/reply`, data)

export const reserveInvoiceDelivery = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/delivery`, data)

export const qualityQuery = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/quality/query`, data)

export const reserveInvoiceQuery = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/reserveInvoice/query`, data)

export const createByScanCode = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/createByScanCode`, data)

export const qualityexport = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/quality/export`, data)
export const updatePreloadQty = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/box/updatePreloadQty`, data)

//仓库
export const getWarehouseListBySearch = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/warehouseInfo/getWarehouseList`, data)

//采购单明细
export const getPurchaseCommodity = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/order/commodity/getPurchaseCommodity`, data)
export const queryReserveInvoicePurchaseDetail = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/purchase/order/commodity/queryReserveInvoicePurchaseDetail`, data)

//生产进度
export const getProduceSchedule = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/getProduceSchedule`, data)
export const updateProduceSchedule = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/updateProduceSchedule`, data)
export const updateScheduleTime = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/updateScheduleTime`, data)
export const scheduleDelete = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/purchase/produce/schedule/delete`, data)
export const getReserveInvoiceWithPurchase = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/reserveInvoice/getReserveInvoiceWithPurchase`, data)
export const printBoxLabels = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/reserveInvoice/printBoxLabels`, data)
export const getBoxLabelPrintInfo = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestData(`/api/sop/sop/box/getBoxLabelPrintInfo`, data)

//意向订单
export const queryIntentOrderList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/intentOrder/queryIntentOrder`, data)
export const exportIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/exportIntentOrder`, data)
export const exportIntentOrderNew = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop//intentOrder/exportIntentOrder2`, data)
export const getListIntentOrderSpuByCodes = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/listIntentOrderSpuByCodes`, data)
export const getListIntentOrderDevByDesignCode = <T>(data?: string): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/listIntentOrderDevByDesignCode?designCode=` + data, {})
export const generatePurchaseOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/generatePurchaseOrder`, data)
export const associateSkuCode = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/associateSkuCode`, data)
export const intentOrderImportReply = <T>(data?: any): Promise<IResponsePost<T>> =>
  importFile(`/api/sop/sop/intentOrder/importReply`, data)
export const intentOrderReplyIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/replyIntentOrder`, data)
export const intentOrderCancelIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/cancelIntentOrder`, data)
export const copyIntentOrderIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/copyIntentOrder`, data)
export const rejectIntentOrderIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/rejectIntentOrder`, data)
export const qualityTodo = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/quality/qualityTodo`, data)
export const getByIntentOrderCode = <T>(data?: any): Promise<IResponseDetail<T>> =>
  postRequestJson(`/api/sop/sop/quotationOrder/getIntentDetailQuotation`, data)
export const splitIntentOrder = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/intentOrder/splitIntentOrder`, data)
